﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.SYS
{
    [Table("SysSearchResultDtl")]
    public class SearchResultDtl
    {
        [DataMember, Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public virtual int SearchDtlId { get; set; }
        [DataMember]
        public virtual int SearchId { get; set; }
        [DataMember]
        public int DataId { get; set; }
        [DataMember]
        public string DataCode { get; set; }
        [DataMember]
        public string DataName { get; set; }
        [DataMember]
        public string DataDescription { get; set; }
        [DataMember]
        public string DataOtherText { get; set; }
        [DataMember]
        public string DataSiteNavigatePath { get; set; }
        [DataMember]
        public string DataFileImageUrl { get; set; }
        [DataMember]
        public string DataSeacrhOptionEnum { get; set; }
        [DataMember]
        public int ScoreCount { get; set; }
        [DataMember]
        public string DataRecordStatus { get; set; }
        [DataMember]
        public int? DataCreatedBy { get; set; }
        [DataMember]
        public string DataCreatedByFullName { get; set; }
        [DataMember]
        public DateTime? DataCreatedWhen { get; set; }
        [DataMember]
        public int? DataUpdatedBy { get; set; }
        [DataMember]
        public string DataUpdatedByFullName { get; set; }
        [DataMember]
        public DateTime? DataUpdatedWhen { get; set; }
        [NotMapped]
        public string AllText
        {
            get
            {
                return DataCode + DataName + DataDescription + DataOtherText +
                       DataSiteNavigatePath + DataFileImageUrl +
                       DataSeacrhOptionEnum;
            }
        }

        [NotMapped]
        public string AllEmployee
        {
            get { return DataCreatedByFullName + DataUpdatedByFullName; }
        }
    }
}
